/*
 * Copyright (C) 2009, 2010 Nick Johnson <nickbjohnson4224 at gmail.com>
 * 
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <ctype.h>

/****************************************************************************
 * _ctype_tbl
 *
 * Table of flag values for each ASCII character. Used for various functions
 * in <ctype.h>
 */

uint16_t _ctype_tbl[256] = {
/* 	NUL		SOH		STX		ETX		EOT		ENQ		ACK		BEL */
	0x000,	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,
/*	BS		TAB		LF		VT		FF		CR		SI		SO	*/
	0x080,	0x280,	0x280,	0x280,	0x280,	0x280,	0x008,	0x008,
/*	DLE		DC1		DC2		DC3		DC4		NAK		SYN		ETB	*/
	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,
/*	CAN		EM		SUB		ESC		FS		GS		RS		US	*/
	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,	0x008,
/*	Space	!		"		#		$		%		&		'	*/
	0x2A0,	0x180,	0x180,	0x180,	0x180,	0x180,	0x180,	0x180,
/*	(		)		*		+		,		-		.		/	*/
	0x180,	0x180,	0x180,	0x180,	0x180,	0x180,	0x180,	0x180,
/*	0		1		2		3		4		5		6		7	*/
	0x891,	0x891,	0x891,	0x891,	0x891,	0x891,	0x891,	0x891,
/*	8		9		:		;		<		=		>		?	*/
	0x891,	0x891,	0x180,	0x180,	0x180,	0x180,	0x180,	0x180,
/*	@		A		B		C		D		E		F		G	*/
	0x180,	0xC83,	0xC83,	0xC83,	0xC83,	0xC83,	0xC83,	0x483,
/*	H		I		J		K		L		M		N		O	*/
	0x483,	0x483,	0x483,	0x483,	0x483,	0x483,	0x483,	0x483,
/*	P		Q		R		S		T		U		V		W	*/
	0x483,	0x483,	0x483,	0x483,	0x483,	0x483,	0x483,	0x483,
/*	X		Y		Z		[		\		]		^		_	*/
	0x483,	0x483,	0x483,	0x180,	0x180,	0x180,	0x180,	0x180,
/*	`		a		b		c		d		e		f		g	*/
	0x180,	0x8C3,	0x8C3,	0x8C3,	0x8C3,	0x8C3,	0x8C3,	0x0C3,
/*	h		i		j		k		l		m		n		o	*/
	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,
/*	p		q		r		s		t		u		v		w	*/
	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,	0x0C3,
/*	x		y		z		{		|		}		~		DEL	*/
	0x0C3,	0x0C3,	0x0C3,	0x180,	0x180,	0x180,	0x180,	0x080,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,

	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000,	0x000
};
